home *** CD-ROM | disk | FTP | other *** search
/ kermit.columbia.edu / kermit.columbia.edu.tar / kermit.columbia.edu / newsgroups / misc.20010306-20010921 / 000058_news@columbia.edu _Thu Apr 5 15:12:52 2001.msg < prev    next >
Internet Message Format  |  2001-09-20  |  2KB

  1. Return-Path: <news@columbia.edu>
  2. Received: from newsmaster.cc.columbia.edu (newsmaster.cc.columbia.edu [128.59.59.30])
  3.     by fozimane.cc.columbia.edu (8.9.3/8.9.3) with ESMTP id PAA11492
  4.     for <kermit.misc@cpunix.cc.columbia.edu>; Thu, 5 Apr 2001 15:12:50 -0400 (EDT)
  5. Received: (from news@localhost)
  6.     by newsmaster.cc.columbia.edu (8.9.3/8.9.3) id PAA29678
  7.     for kermit.misc@watsun.cc.columbia.edu; Thu, 5 Apr 2001 15:07:39 -0400 (EDT)
  8. X-Authentication-Warning: newsmaster.cc.columbia.edu: news set sender to <news> using -f
  9. From: grante@visi.com (Grant Edwards)
  10. Subject: Re: Macro prameters containing spaces?
  11. Message-ID: <Yn3z6.11074$SB2.1263103@ruti.visi.com>
  12. Date: Thu, 05 Apr 2001 19:07:36 GMT
  13. To: kermit.misc@columbia.edu
  14.  
  15. In article <9aif5j$sbs$1@newsmaster.cc.columbia.edu>, Frank da Cruz wrote:
  16.  
  17. >: I'm trying to automate some stuff done via serial port using
  18. >: CKermit 7.  My local B&N didn't carry the book, so I've ordered
  19. >: a copy.  But, in the meanwhile, I'm stuck on trying to write a
  20. >: macro where one of the parameters is a string that may have
  21. >: spaces in it:
  22. >: 
  23. >: define docmd {
  24. >: output \fcontents(\%2)
  25. >: output \13
  26. >: input \%1 Prompt>
  27. >: if failure echo FAILURE
  28. >: }
  29. >: 
  30. >: define setup {
  31. >: docmd 1 hello
  32. >: docmd 1 "ip 192.168.1.11 255.255.255.0 192.168.1.1"
  33.  
  34. That apparently needs to be:
  35.  
  36.    docmd 1 {ip 192.168.1.11 255.255.255.0 192.168.1.1}
  37.  
  38. The double-quotes are apparently passed as normal text, so with
  39. the previous version the second parameter is "ip, the third is
  40. 192.168.1.11, etc.
  41.  
  42. >There's nothing wrong with your script as far as argument
  43. >passing is concerned, as you can verify for youself with TRACE
  44. >/ON or by putting SHOW ARGS as the first command in DOCMD.  I
  45. >ran your SETUP macro myself, supplying a "Prompt>" string four
  46. >times, and it worked fine.
  47.  
  48. It worked fine once I used curly-braces instead of
  49. double-quotes to quote the parameter string.  As usual: pull
  50. your hair out for hours with no results.  Post the question to
  51. Usenet, and you figure it out minutes later.
  52.  
  53. -- 
  54. Grant Edwards                   grante             Yow!  I have a very good
  55.                                   at               DENTAL PLAN. Thank you.
  56.                                visi.com